package com.ldc.framework.adapter

import com.ldc.commonlibs.listener.OnRowListener
import com.ldc.commonres.common.BaseRvAdapter
import com.ldc.commonres.common.BaseRvViewHolder
import com.ldc.framework.R
import com.ldc.framework.model.HotKeyModel

class HotKeyAdapter :
    BaseRvAdapter<HotKeyModel>(R.layout.framework_layout_view_item_hot_key) {
    private var onRowListener: OnRowListener<HotKeyModel>? = null
    fun addOnRowListener(onRowListener: OnRowListener<HotKeyModel>?) {
        this.onRowListener = onRowListener
    }

    override fun convertTo(holder: BaseRvViewHolder, data: HotKeyModel, position: Int) {
        holder.addOnRowListener(holder.itemView, data, onRowListener)
        holder.setText(com.ldc.commonres.R.id.tv_name, data.name)
    }
}